home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-01-11 | 4.6 KB | 106 lines | [TEXT/CWIE] |
- // SpritePersistence.h
-
- #ifndef __SPRITEPERSISTENCE_
- #define __SPRITEPERSISTENCE_
-
-
- ///©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©
- // PUBLIC
- ///©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©
-
- ///≈≈≈≈≈≈≈≈ Public data ≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈
-
- // ******************************************************************************
- // *** tSpriteSaveRec is to be changed depending on the data you want to save ***
- // ******************************************************************************
- typedef struct tSpriteSaveRec
- {
- SInt16 hz; // sprite's coords
- SInt16 vt; // ''
- SInt32 userDataExample; // just another example
- }
- tSpriteSaveRec, * tSpriteSavePtr, ** tSpriteSaveHandle;
-
- // ******************************************************************************
- // *** kMaxSpritesInOneLayer must be >= the max number of sprites in the most ***
- // *** populated layer which you are going to save. It is only used for ***
- // *** computing resource ID values (see the FAQs for info about this value) ***
- // ******************************************************************************
- #define kMaxSpritesInOneLayer 200 // change this if you use more
-
- // NOTE: currently, SpritePersistence overrides DataPersistence's resource type
- #define kSpriteSaveRezType 'SPRI' // change this if you like
-
- // NOTE: currently, this module does not set it's own file: uses the standard data file
- //#define kSpriteSaveFileName "\pSprite Persistence" // (change this if you like)
-
- // NOTE: currently, the file type and creator are not used
- //#define kSpriteSaveFileType 'SPRI' // (change this if you like)
- //#define kSpriteSaveFileCreator '????' // (change this if you like)
-
-
- ///≈≈≈≈≈≈≈≈ Public prototypes ≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈
-
- // ****************************************************************************
- // *** The following two routines are to be changed for your application. ***
- // *** They are called, respectively, just before writing to disk, and ***
- // *** just after having read a sprite record from disk. ***
- // ****************************************************************************
- void SWGCopyFromSpriteToRecord (SpritePtr spriteP, tSpriteSaveHandle recordHandle);
- void SWGCopyFromRecordToSprite (tSpriteSaveHandle recordHandle, SpritePtr spriteP);
-
- // ****************************************************************************
- // *** The following routine may to be changed for your application. ***
- // ****************************************************************************
- SInt16 SWGComputeResourceID (SInt16 layerNum, SInt16 spriteNum, SpritePtr spriteP);
-
- // Other public prototypes (and macros); they shouldn't need to be adapted
-
- #define SWGSaveSpritesInAllLayers(x) SWGDoSpritesInAllLayers (x, true)
- #define SWGLoadSpritesInAllLayers(x) SWGDoSpritesInAllLayers (x, false)
-
- #define SWGSaveSpritesInLayer(x) SWGDoSpritesInLayer (x, true)
- #define SWGLoadSpritesInLayer(x) SWGDoSpritesInLayer (x, false)
-
- #define SWGSaveSingleSprite (x,y,z) SWGDoSingleSprite (x, y, z, true)
- #define SWGLoadSingleSprite (x,y,z) SWGDoSingleSprite (x, y, z, false)
-
- SInt16 SWGGetLayerNumber (SpriteLayerPtr spriteLayerP);
- SInt16 SWGGetSpriteNumber (SpritePtr spriteP);
-
- // Called through the 6 SWGSave/Load macros above => must be made public
-
- OSErr SWGDoSpritesInAllLayers (SpriteWorldPtr spriteWorldP, Boolean write);
- OSErr SWGDoSpritesInLayer (SpriteLayerPtr spriteLayerP, Boolean write);
- OSErr SWGDoSingleSprite (SInt16 layerNum, SInt16 spriteNum, SpritePtr spriteP, Boolean write);
-
-
- ///©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©
- // PRIVATE
- ///©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©
-
- #ifdef OWNER
-
- ///≈≈≈≈≈≈≈≈ Private data ≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈
-
- Boolean gSWGSpriteSaveFileIsOpen = false;
- Boolean gSWGSpriteSaveIntoApp = false;
- SInt16 gSWGCurrentResFile = -1;
- SInt16 gSWGSaveResFile = -1;
-
- Handle gSWGBufferHandle = nil;
-
-
- ///≈≈≈≈≈≈≈≈ Private prototypes ≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈≈
-
- OSErr _SWGSaveSingleSprite (SInt16 layerNum, SInt16 spriteNum, SpritePtr spriteP);
- OSErr _SWGLoadSingleSprite (SInt16 layerNum, SInt16 spriteNum, SpritePtr spriteP);
- OSErr _SWGCreateBufferHandle (void);
-
-
- #endif // OWNER
-
- #endif // __SPRITEPERSISTENCE_
-
- // end
-